# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=pdm
pkgver=2.18.2
pkgrel=0
pkgdesc="Modern Python package and dependency manager"
url="https://pdm.fming.dev/"
arch="all"
license="MIT"
depends="
	py3-blinker
	py3-cachecontrol
	py3-certifi
	py3-dep-logic
	py3-dotenv
	py3-findpython
	py3-installer
	py3-packaging
	py3-pbs-installer
	py3-platformdirs
	py3-pyproject-hooks
	py3-requests-toolbelt
	py3-resolvelib
	py3-rich
	py3-shellingham
	py3-tomlkit
	py3-truststore
	py3-unearth
	py3-virtualenv
	"
makedepends="py3-pdm-backend py3-gpep517 py3-installer"
checkdepends="
	bash
	py3-hishel
	py3-pytest
	py3-pytest-httpserver
	py3-pytest-mock
	py3-pytest-rerunfailures
	"
subpackages="$pkgname-pyc"
source="https://github.com/pdm-project/pdm/archive/$pkgver/pdm-$pkgver.tar.gz"
options="net" # TODO: why does this even do networking in tests

build() {
	export PDM_BUILD_SCM_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest \
		-k 'not test_use_wrapper_python' \
		--deselect tests/cli/test_build.py::test_build_with_no_isolation
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
11f745b08fa8a56d80b25d148b7abf5254d797e5aedddbf944f2aaac14cafa3691484ef18af799fc8aaeefd397f8066b9316d673774c6cd4e252920cd76329b7  pdm-2.18.2.tar.gz
"
